package chan.project.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import chan.project.model.dto.location.LocationQueryRequest;
import chan.project.model.entity.Location;
import chan.project.model.vo.LocationVO;

import javax.servlet.http.HttpServletRequest;

/**
 * 地点服务
 *
 * @author <a href="https://github.com/kavansp">kavansp</a>
 * 
 */
public interface LocationService extends IService<Location> {

    /**
     * 校验数据
     *
     * @param location
     * @param add 对创建的数据进行校验
     */
    void validLocation(Location location, boolean add);

    /**
     * 获取查询条件
     *
     * @param locationQueryRequest
     * @return
     */
    QueryWrapper<Location> getQueryWrapper(LocationQueryRequest locationQueryRequest);
    
    /**
     * 获取地点封装
     *
     * @param location
     * @param request
     * @return
     */
    LocationVO getLocationVO(Location location, HttpServletRequest request);

    /**
     * 分页获取地点封装
     *
     * @param locationPage
     * @param request
     * @return
     */
    Page<LocationVO> getLocationVOPage(Page<Location> locationPage, HttpServletRequest request);
}
